package net.lahuobao.enums.mall.finance;

/**
 * Created by clark on 2016/9/5 0005.
 * 账户类型枚举
 */
public enum  EFinAccountType {
    /*商城中间账号,从0 开始*/
    MallOilCardRecharge {
        public int getValue() {
            return 0;
        }
        public String getName() {
            return "商城油卡充值金额账号";
        }
    },
    MallShoppingBalance {
        public int getValue() {
            return 1;
        }

        public String getName() {
            return "商城商品购买余额账户";
        }
    },


    /*手续费收入账号,从101开始*/
    AliPayPoundage {
        public int getValue() {
            return 101;
        }

        public String getName() {
            return "支付宝手续费账户";
        }
    },
    ECardToBalancePoundage {
        public int getValue() {
            return 102;
        }

        public String getName() {
            return "E卡转余额手续费账户";
        }
    },
    SettlementAdvancePoundage {
        public int getValue() {
            return 103;
        }

        public String getName() {
            return "商家提前结算手续费账户";
        }
    },
    SettlementExpenses {
        public int getValue() {
            return 104;
        }

        public String getName() {
            return "商家结算服务费账户";
        }
    },

    /*备份金账户，从201 开始*/
    ECardBalance {
        public int getValue() {
            return 201;
        }

        public String getName() {
            return "E卡备付金余额账户";
        }
    },
    IntegralBalance {
        public int getValue() {
            return 202;
        }

        public String getName() {
            return "积分备付金余额账户";
        }
    },

    /*抵扣入账账号,从301开始*/
    ECard {
        public int getValue() {
            return 301;
        }

        public String getName() {
            return "E卡数账户";
        }
    },
    Integral {
        public int getValue() {
            return 302;
        }

        public String getName() {
            return "积分数账户";
        }
    },


    /*承运商账户，从401开始*/
    lhbHTHuaChangBalance {
        public int getValue() {
            return 401;
        }

        public String getName() {
            return "宏图华昌余额账户";
        }
    };

    public static String valueOf(int value) {
        switch (value) {
             /*商城中间账号,从0 开始*/
            case 0:
                return EFinAccountType.MallOilCardRecharge.getName();
            case 1:
                return EFinAccountType.MallShoppingBalance.getName();

           /*手续费收入账号,从101 开始*/
            case 101:
                return EFinAccountType.AliPayPoundage.getName();
            case 102:
                return EFinAccountType.ECardToBalancePoundage.getName();
            case 103:
                return EFinAccountType.SettlementAdvancePoundage.getName();
            case 104:
                return EFinAccountType.SettlementExpenses.getName();
            /*备份金账户，从21 开始*/
            case 201:
                return EFinAccountType.ECardBalance.getName();
            case 202:
                return EFinAccountType.IntegralBalance.getName();
             /*抵扣入账账号,从31开始*/
            case 301:
                return EFinAccountType.ECard.getName();
            case 302:
                return EFinAccountType.Integral.getName();
          /*承运商账户,从41 开始*/
//            case 21:
//                return EFinAccountType.LhbBalance.getName();
            case 401:
                return EFinAccountType.lhbHTHuaChangBalance.getName();
        }
        return null;
    }

    public static EFinAccountType getEFinAccountType(int value) {
        switch (value) {
             /*商城中间账号,从0 开始*/
            case 0:
                return EFinAccountType.MallShoppingBalance;
            case 1:
                return EFinAccountType.MallOilCardRecharge;
           /*手续费收入账号,从11 开始*/
            case 101:
                return EFinAccountType.AliPayPoundage;
            case 102:
                return EFinAccountType.ECardToBalancePoundage;
            case 103:
                return EFinAccountType.SettlementAdvancePoundage;
            case 104:
                return EFinAccountType.SettlementExpenses;
            /*备份金账户，从21 开始*/
            case 201:
                return EFinAccountType.ECardBalance;
            case 202:
                return EFinAccountType.IntegralBalance;
             /*抵扣入账账号,从31开始*/
            case 301:
                return EFinAccountType.ECard;
            case 302:
                return EFinAccountType.Integral;
          /*承运商账户,从41 开始*/
//            case 21:
//                return EFinAccountType.LhbBalance.getName();
            case 401:
                return EFinAccountType.lhbHTHuaChangBalance;
        }
        return null;
    }

    public abstract int getValue();

    public abstract String getName();
}
